(cl:in-package #:sicl-boot-phase-4)

(defun boot (boot)
  (format *trace-output* "Start phase 4~%")
  (with-accessors ((e2 sicl-boot:e2)
                   (e3 sicl-boot:e3)
                   (e4 sicl-boot:e4))
      boot
    (change-class e4 'environment)
    (change-class (env:client e4) 'client)
    (let ((sicl-client:*client* (make-instance 'client)))
      (import-from-host e4)
      (pre-fill-environment e4)
      (prepare-this-phase e2 e3 e4)
      (load-source-file "Symbol/symbol-value-etc-defuns.lisp" e4)
      (sicl-boot:create-accessor-defgenerics e4)
      (sicl-boot:create-classes e4)
      ;; (load-source-file "CLOS/class-readers-forward-referenced-class-defmethods.lisp" e4)
      ;; (load-source-file "CLOS/class-readers-defmethods-before.lisp" e4)
      (load-source-file "Symbol/symbol-value-etc-defuns.lisp" e4))))
